import { Component, OnInit, Output, EventEmitter } from "@angular/core";
import { NzCascaderOption } from "ng-zorro-antd";
import { Regions } from "../one-map";

@Component({
  selector: "app-map-region",
  templateUrl: "./map-region.component.html",
  styleUrls: ["./map-region.component.scss"]
})
export class MapRegionComponent implements OnInit {
  @Output() changeRegion = new EventEmitter();
  regionsShow: boolean = false;
  regions: any[] = Regions;
  regionSelected: any = Regions[0];

  constructor() {}

  ngOnInit() {}

  onChangeRegion(values: string[]): void {
    console.log(values);
    this.changeRegion.emit(values);
  }

  validate(option: NzCascaderOption, index: number): boolean {
    return true;
  }
}
